package com.itheima.pattern.iterator;

import java.util.ArrayList;
import java.util.List;


//学生集合
public class StudnetAggregateImpl implements StudentAggregate{

    private List<Student> list=new ArrayList<>();

    @Override
    public void addStudnet(Student student) {
        list.add(student);
    }

    @Override
    public void removeStudnet(Student student) {
        list.remove(student);
    }

    @Override
    public StudentIterator getStudentIterator() {

        return new StudentIteratorImpl(list);
    }
}
